<?php $this->pageTitle = "Account Login"; ?>
<?php Yii::app()->publishAndRegisterCssFile($_SERVER['DOCUMENT_ROOT'] . '/css/app.account.login.standard.css'); ?>
<?php
$form = $this->beginWidget('CActiveForm', array(
	'id' => 'login-form',
	'enableAjaxValidation' => true,
	'htmlOptions' => array(
		'class' => 'form',
	)
		));
?>


<?php echo $form->errorSummary($model); ?>
<div id="login_box_wrapper" class="relative">
	<div id="agency-login-header" class="align-center">
		<?php if ($agency != null): ?>
			<img src="<?php echo $agency->logo; ?>" alt="<?php echo $agency->name; ?>" class="agency-logo" style="max-width: 400px;" /><br/>
			<h1>Welcome to <?php echo ucwords(strtolower($agency->name)); ?></h1>
		<?php else: ?>
			<?php if ($mode == 'Agency'): ?>
				<img src="/images/house_prestige_200x96.png" width="200" style="margin-top: 0px;" />
			<?php else: ?>
				<img src="/images/logo_propsage_full.png" width="200" style="margin-top: 0px;" />
			<?php endif; ?>
		<?php endif; ?>
    </div>
    <div id="login_box" class="round_all">
        <br/>
        <label class="fields">
            <strong>Username:</strong>
			<?php echo $form->textField($model, 'username', array('class' => 'indent', 'autcomplete' => 'off')); ?>
        </label>
        <label class="fields">
            <strong>Password</strong>
			<?php echo $form->passwordField($model, 'password', array('class' => 'indent', 'autcomplete' => 'off')); ?>
        </label>
        <label class="fields">
            <strong>Login as</strong>
			<?php echo $form->radioButtonList($model, 'app', array(
				'TopAchiever' => 'Salesperson', 
				'Prestige' => 'Agency', 
				), array('class' => '', 'autcomplete' => 'off')); ?>
        </label>
        <button class="button_colour round_all" type="submit" name="Login">
            <img width="24" height="24" src="/themes/adminica/images/icons/small/white/locked_2.png" alt="Locked 2" />
            <span>Login</span>
        </button>
        <div id="signup-now" class ="row">
            Don't have a account? <br/><?php echo CHtml::link("Sign up now", array('account/identify'), array('class' => 'link'));
			?>
        </div>

        <div class="clear"></div>
        <div id="bar" class="round_bottom">
            <label><?php echo $form->checkBox($model, 'rememberMe', array('checked' => true));
			?>Auto-login in future.</label>
			<?php echo CHtml::link('Forgot your Password?', array('account/forgetPassword'));
			?>
        </div>
    </div><!-- form -->
</div>
<?php $this->endWidget(); ?>
